package com.example.evanproject.mapper;

import com.example.evanproject.domain.Coursefeedback;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author hanxiaoqi
* @description 针对表【coursefeedback】的数据库操作Mapper
* @createDate 2024-03-09 21:52:12
* @Entity generator.domain.Coursefeedback
*/
@Mapper
public interface CoursefeedbackMapper extends BaseMapper<Coursefeedback> {
    @Insert("insert into coursefeedback (course_id,people_id,cf_start,cf_content,cf_time) values(#{cId},#{sId},#{start},#{content},#{time})")
    Integer createfeed(Integer cId, Integer sId, Integer start, String content, String time);

    @Select("select * from coursefeedback where course_id=#{cid}")
    List<Coursefeedback> selectallfeed(Integer cid);

    //查找用户评价的那些课程
    @Select("SELECT * from coursefeedback where people_id=#{userid}")
    List<Coursefeedback> selectByuserid(Integer userid);

    //和删除某个用户评价的内容

    @Delete("delete from coursefeedback where cf_id=#{feedId}")
    Integer deletefeedinfo(Integer feedId);
}




